:root {
  --primary-color: #646cff;
  --secondary-color: #535bf2;
  --background-dark: #1a1a1a;
  --chat-bg: #242424;
  --text-primary: #ffffff;
  --text-secondary: #888888;
  --success-color: #4caf50;
  --error-color: #f44336;
  --gradient-start: #4776e6;
  --gradient-end: #8e54e9;
}

body {
  background-color: var(--background-dark);
  color: var(--text-primary);
  margin: 0;
  min-height: 100vh;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu,
    Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
}

#root {
  max-width: 1280px;
  height: 100vh;
  margin: 0 auto;
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo {
  height: 6em;
  padding: 1.5em;
  will-change: filter;
  transition: filter 300ms;
}
.logo:hover {
  filter: drop-shadow(0 0 2em #646cffaa);
}
.logo.react:hover {
  filter: drop-shadow(0 0 2em #61dafbaa);
}

@keyframes logo-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: no-preference) {
  a:nth-of-type(2) .logo {
    animation: logo-spin infinite 20s linear;
  }
}

.card {
  padding: 2em;
}

.read-the-docs {
  color: #888;
}

.audio-chat-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  width: 100%;
  max-width: 800px;
  height: 80vh;
  margin: 0 auto;
  padding: 2rem;
  background: var(--chat-bg);
  border-radius: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
}

.audio-chat-container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(
    to right,
    var(--gradient-start),
    var(--gradient-end)
  );
}

.audio-chat-container h1 {
  font-size: 2.5rem;
  margin: 0;
  background: linear-gradient(
    to right,
    var(--gradient-start),
    var(--gradient-end)
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-align: center;
}

.messages-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  margin: 1rem 0;
}

.message {
  padding: 1rem 1.5rem;
  border-radius: 16px;
  max-width: 80%;
  text-align: left;
  animation: messageSlide 0.3s ease-out;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

@keyframes messageSlide {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message.user {
  background: linear-gradient(
    135deg,
    var(--gradient-start),
    var(--gradient-end)
  );
  align-self: flex-end;
  margin-left: 20%;
  color: white;
}

.message.assistant {
  background: rgba(255, 255, 255, 0.1);
  align-self: flex-start;
  margin-right: 20%;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.controls {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  position: relative;
}

.mic-button {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(
    135deg,
    var(--gradient-start),
    var(--gradient-end)
  );
  color: white;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
}

.mic-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.1),
    rgba(255, 255, 255, 0)
  );
  border-radius: 50%;
  transition: transform 0.3s ease;
}

.mic-button:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.mic-button:hover::before {
  transform: translateY(-100%);
}

.mic-button.connected {
  background: var(--error-color);
  animation: pulseError 2s infinite;
}

.mic-button svg {
  width: 32px;
  height: 32px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
  transition: transform 0.3s ease;
}

.mic-button:hover svg {
  transform: scale(1.1);
}

@keyframes pulseError {
  0% {
    box-shadow: 0 0 0 0 rgba(244, 67, 54, 0.4);
  }
  70% {
    box-shadow: 0 0 0 20px rgba(244, 67, 54, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(244, 67, 54, 0);
  }
}

/* Status indicator */
.status-indicator {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.9rem;
  color: var(--text-secondary);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.controls:hover .status-indicator {
  opacity: 1;
}

/* Scrollbar styling */
.messages-container::-webkit-scrollbar {
  width: 8px;
}

.messages-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.messages-container::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--gradient-start), var(--gradient-end));
  border-radius: 4px;
}

.messages-container::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(var(--gradient-end), var(--gradient-start));
}

/* Wave Animation */
.wave-animation {
  position: absolute;
  bottom: -15px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
}

.wave {
  width: 4px;
  height: 15px;
  background: currentColor;
  border-radius: 2px;
  animation: wave 0.5s ease-in-out infinite;
}

@keyframes wave {
  0%,
  100% {
    transform: scaleY(0.5);
  }
  50% {
    transform: scaleY(1.5);
  }
}

/* Loading state */
.mic-button.loading {
  animation: rotate 1s linear infinite;
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
